<?php
namespace app\admin;

class Common{

    const STATE_YES = 10;  //可用
    const STATE_NO = 30;   //禁用
    const STATUS_YES = 10;  //新房
    const STATUS_NO =30;  //旧房


    /*
     * 定义常量
     * */
    public static function Alias($list){
        if(array_key_exists('member_status',$list)){
            $list=self::StatusAlias($list);
            //return 123;
        }
        if(array_key_exists('member_state',$list)){
            $list=self::StateAlias($list);
        }
        return  $list;
    }
    /*
     * 定义标签常量State
     * */
    public static function StateAlias($list){
        $items=array();
        $items=[
            self::STATE_YES => '已拨打',
            self::STATE_NO => '未拨打',
        ];
        $list['member_state']=$items[$list['member_state']];
        return $list;
    }

    /*
     * 定义标签常量Status
     * */
    public static function StatusAlias($list){
        $items=array();
        $items=[
            self::STATUS_YES => '新',
            self::STATUS_NO => '旧',
        ];
        $list['member_status']=$items[$list['member_status']];
        return $list;
    }




}